<?php
//ini_set("display_errors","yes");

$targ_w = $_GET['width_ratio'];
$targ_h = $_GET['height_ratio'];
$jpeg_quality = 90;

$src = $_GET['image_name'];
$img_r = imagecreatefromjpeg($src);
$dst_r = ImageCreateTrueColor($targ_w, $targ_h);

imagecopyresampled($dst_r, $img_r, 0, 0,$_GET['start_x'], $_GET['start_y'], $targ_w, $targ_h, $_GET['width'], $_GET['height']);

header('Content-type: image/jpeg');
imagejpeg($dst_r, null, $jpeg_quality);

?>